package com.qibo.baselib.api;

import android.util.Log;

import com.qibo.baselib.base.BaseApplication;
import com.qibo.baselib.utils.SPUtils;


/**
 * Created by liubo on 2017/6/27 0027.
 */

public class BaseAppConfig {

    private static final String TAG = "BaseAppConfig";

    private static BaseAppConfig mInstance;

    public static Boolean iSopenException = false;
    /**
     * 测试的安装包名
     */
    public static String appSecret = "2222";
    public static String BastUrl = "http://pos.xcx.91keman.com";
    public static String version = "/pos/v1";

    private String userId = "" ;
    private String starId = "" ;
    private String shopId = "" ;

    /******************************user模块*********************/
    /**登录**/
    public static String get_login = BastUrl +version+"/user/login";
    /**发送验证码**/
    public static String get_sendSms = BastUrl +version+"/user/sendSms";


    private BaseAppConfig() {

    }

    public static BaseAppConfig getInstance() {
        if (mInstance != null) {
            return mInstance;
        }
        synchronized (TAG) {
            if (mInstance == null) {
                mInstance = new BaseAppConfig();
            }
        }

        return mInstance;
    }


    public String getUserId() {
        userId=(String) SPUtils.get(BaseApplication.getInstance(),"userId","");
        Log.e("userId+22+",userId);
        return userId;
    }

    public void setUserId(String userId) {
        SPUtils.put(BaseApplication.getInstance(),"userId",userId);
        Log.e("userId+11+",userId);
        this.userId = userId;
    }
    public void removeUserId() {
        SPUtils.remove(BaseApplication.getInstance(),"userId");
        userId=(String)SPUtils.get(BaseApplication.getInstance(),"userId","");
        Log.e("userId+11+",userId);
    }

    public String getStarId() {
        if (starId == null || starId.trim().equals("")){
            return "";
        }
        return starId;
    }

    public void setStarId(String starId) {
        this.starId = starId;
    }

    public String getShopId()
    {
        if (shopId == null || shopId.trim().equals("")){
            return "";
        }
        return this.shopId;
    }

    public void setShopId(String shoppingId)
    {
        this.shopId = shoppingId;
    }
}
